<div class='span12'>
    <!-- HEADER -->
    <div class='row-fluid'>
        <div class='span12'>
            <div class='page-header'>

                <h1 class="span8">
                    <i class='icon-bullhorn'></i>
                    <span>USER MANAGEMENT</span>
                </h1>
                <div class="span4 text-right">
                    <a href="<?= URL::to('admin/user/create');?>" class="btn btn-large btn-inverse">Create New</a>
                </div>
            </div>
        </div>
    </div>

    <!-- END OF HEADER -->


    <div class='row-fluid'>
        <div class="span12 box bordered-box blue-border" style="margin-bottom:0;">
            <div class="box-header blue-background">
                <div class="title">List of Users</div>
                <div class="actions">
                    <a href="#" class="btn box-remove btn-mini btn-link"><i class="icon-remove"></i>
                    </a>
                    <a href="#" class="btn box-collapse btn-mini btn-link"><i></i>
                    </a>
                </div>
            </div>
            <div class="box-content box-no-padding">
                <div class="responsive-table">
                    <div class="scrollable-area">
                        <table class="table" style="margin-bottom:0;">
                            <?php if($userss){?>
                                <thead>
                                <tr>
                                    <th>
                                        Title
                                    </th>
                                    <th>
                                        Role
                                    </th>
                                    <th>
                                        Status
                                    </th>
                                    <th></th>
                                </tr>
                                </thead>
                                <tbody>

                                <?php foreach($userss->results as $users):?>
                                
                                    <tr>

                                        <td><?= $users->name;?></td>
                                        <td>
                                        
                                        <span class="label label-success"><?= Users::find($users->id)->role()->first()->name ;?></span>
                                           
                                        </td>
                                        <td>


                                            <?php if($users->status == 51){?>
                                                <span class="label label-success">Active</span>
                                            <?php }else{ ?>
                                                <span class="label label-important">Inactive</span>
                                            <?php } ?>
                                        </td>
                                        <td>
                                            <div class="text-right">
                                                <?php if($users->status == "1"){?>
                                                <a class="btn btn-success btn-mini" href="<?= URL::to("admin/user/update_status/$users->id/$users->status");?>" title="Make it Active"
                                                 <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                                                    Active
                                                </a>
                                                <?php }?>
                                                <?php if($users->status == "51"){?>
                                                    <a class="btn btn-danger btn-mini" href="<?= URL::to("admin/user/update_status/$users->id/$users->status");?>" title="Make it Inactive"
                                                     <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                                                        Inactive
                                                    </a>
                                                <?php }?>

                                                <a class="btn btn-success btn-mini" href="<?= URL::to("admin/user/edit/$users->id");?>" title="Edit">
                                                    <i class="icon-edit"></i>
                                                </a>
                                                <a class="btn btn-danger btn-mini" href="<?= URL::to("admin/user/delete/$users->id");?>" title="Delete"  <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                                                    <i class="icon-remove"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>

                                <?php endforeach;?>



                                </tbody>
                            <?php }else{?>
                                <div class="alert alert-danger">No data found..</div>
                            <?php }?>
                        </table>
                         <div class="pull-right">
			<?php echo $userss->links(); ?>
			</div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- END OF CONTENT -->
</div>



